<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>返回一个可用驱动的数组</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="pdo.getattribute.html">PDO::getAttribute</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="pdo.intransaction.html">PDO::inTransaction</a></div>
 <div class="up"><a href="class.pdo.html">PDO</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="pdo.getavailabledrivers" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">PDO::getAvailableDrivers</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.1.3, PECL pdo &gt;= 1.0.3)</p><p class="refpurpose"><span class="refname">PDO::getAvailableDrivers</span> &mdash; <span class="dc-title">
   返回一个可用驱动的数组
  </span></p>

 </div>
 <div class="refsect1 description" id="refsect1-pdo.getavailabledrivers-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">static</span> <span class="type">array</span>  <span class="methodname"><strong>PDO::getAvailableDrivers</strong></span>
    ( <span class="methodparam">void</span>
   )</div>

  <div class="methodsynopsis dc-description">
   <span class="type">array</span>  <span class="methodname"><strong>pdo_drivers</strong></span>
    ( <span class="methodparam">void</span>
   )</div>

  <p class="para rdfs-comment">
   此函数（方法）返回所有当前可用在 <span class="function"><a href="pdo.construct.html" class="function">PDO::__construct()</a></span> 的参数 <em><code class="parameter">DSN</code></em> 中的 PDO 驱动。
  </p>

 </div>

 <div class="refsect1 returnvalues" id="refsect1-pdo.getavailabledrivers-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   <span class="function"><strong>PDO::getAvailableDrivers()</strong></span> 返回一个 包含可用 PDO 驱动名字的数组。如果没有可用的驱动，则返回一个空数组。
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-pdo.getavailabledrivers-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-899">
    <p><strong>Example #1 一个 <span class="function"><strong>PDO::getAvailableDrivers()</strong></span> 的例子</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">PDO</span><span style="color: #007700">::</span><span style="color: #0000BB">getAvailableDrivers</span><span style="color: #007700">());<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程的输出类似于：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
Array
(
    [0] =&gt; mysql
    [1] =&gt; sqlite
)
</pre></div>
    </div>
   </div>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="pdo.getattribute.html">PDO::getAttribute</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="pdo.intransaction.html">PDO::inTransaction</a></div>
 <div class="up"><a href="class.pdo.html">PDO</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
